package cn.getech.data.development.constant;


import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * @author zenith
 * @Description 所有数据库的枚举
 */
@Getter
public enum RouteTypeEnum {

    STATUS(0,"status","按运行状态","ROUTE_NODE", Arrays.asList("=")),
    COUNT(1,"count","按输出表总量","ROUTE_TABLE", Arrays.asList("=","!=",">","<",">=","<="));

    RouteTypeEnum(Integer id,String name,String nameDes,String type,List<String> opters) {
        this.id = id;
        this.name = name;
        this.nameDes = nameDes;
        this.type = type;
        this.opters = opters;
    }

    private Integer id;
    private String name;
    private String nameDes;
    private String type;
    private List<String> opters;


    public static RouteTypeEnum ObjOf(Integer id) {
        if (id == null) {
            return null;
        } else {
            for (RouteTypeEnum s : RouteTypeEnum.values()) {
                if (s.getId() == id) {
                    return s;
                }
            }
            return null;
        }
    }
}
